//
//  PCMyMessageManager.m
//  PromotionCode
//
//  Created by uuu9 on 2018/4/2.
//  Copyright © 2018年 My. All rights reserved.
//

#import "PCMyMessageManager.h"
#import "PCMyMessageModel.h"
#import "PCMyMessageCountModel.h"
@implementation PCMyMessageManager

+ (void)getMyMessageListWithUserid:(NSString *)userid andSession:(NSString *)session andCompletionHandle:(void (^)(PCMyMessageModel *model, NSError *error))complete{
    [self EncryptPOST:[NSString stringWithFormat:@"%@%@",Api_URL,kGetMyMessage]
    parameters:[NSString stringWithFormat:@"userid=%@&sessionid=%@",userid,session]
completionHandler:^(id responseObj, NSError *error) {
    PCMyMessageModel *model = [PCMyMessageModel mj_objectWithKeyValues:responseObj];
    if (model.error_code != 0) {
        error = [self createError:model.error_msg];
    }
    complete(model,error);
}];
}

+ (void)getMyMessageCountWithUserid:(NSString *)userid andSession:(NSString *)session andCompletionHandle:(void (^)(PCMyMessageCountModel *model, NSError *error))complete{
    [self EncryptPOST:[NSString stringWithFormat:@"%@%@",Api_URL,kGetMyMessageCount]
           parameters:[NSString stringWithFormat:@"userid=%@&sessionid=%@",userid,session]
    completionHandler:^(id responseObj, NSError *error) {
        PCMyMessageCountModel *model = [PCMyMessageCountModel mj_objectWithKeyValues:responseObj];
        if (model.error_code != 0) {
            error = [self createError:model.error_msg];
        }
        complete(model,error);
    }];
}


@end
